package com.lhwb.escsvinput.vo.conver;

import java.util.List;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.converters.ReadConverterContext;
import com.alibaba.fastjson.JSON;

import com.lhwb.escsvinput.vo.Genre;

public class GenreListConverter implements Converter<List<Genre>> {

    @Override
    public List<Genre> convertToJavaData(ReadConverterContext<?> context) {
        try {
            return JSON.parseArray(context.getReadCellData().getStringValue(), Genre.class);
        }catch (Exception e) {
            System.out.println("转换失败"+context.getReadCellData().getStringValue());
            return null;
        }
    }

}